package com.crl.game.simulation.common.manager
{
	import com.crl.game.simulation.common.Performer;
	import com.crl.game.simulation.server.Actor;
	import com.crl.manager.ITickable;
	
	import flash.utils.Dictionary;
	
	/**
	 * 调度管理器; 
	 * @author crl
	 * 
	 */	
	public class ScheduleManager implements ITickable
	{
		/**
		 * 被调度列表;
		 */		
		private var schedule:Dictionary;
		public function ScheduleManager()
		{
			schedule=new Dictionary();
		}
		
		
		public function set(key:int,value:Performer):void{
			schedule[key]=value;
			if(value){
				delete schedule[key];
			}
		}
		
		
		
		
		
		/**
		 * 做排序任务; 
		 * 
		 */		
		public function tick(time:int):void{
			for each(var actor:Actor in schedule){
				actor.tick(time);
			}
		}
	}
}